/*
 * @Author: your name
 * @Date: 2022-04-15 17:27:46
 * @LastEditTime: 2022-07-25 08:30:05
 * @LastEditors: YNT 2501512800@qq.com
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \22-03-19 智慧社区\api\social.js
 */
import wxRequest from '../utils/wx-request'

class SpecialModel extends wxRequest {
  // 社群列表
  communityList(params) {
    return this.request({
      url: `/api/v1/community/list`,
      method: 'GET',
      params,
    })
  }

  // 社群详情
  communityDetail(id) {
    return this.request({
      url: `/api/v1/community?id=${id}`,
    })
  }

  // 加入社群
  joinSocial(data) {
    return this.request({
      url: `/api/v1/community`,
      method: 'POST',
      data,
    })
  }

  // 咨询列表
  consultList(params) {
    return this.request({
      url: `/api/v1/community/news/list`,
      method: 'POST',
      params,
    })
  }

  // 咨询详情
  consultDetail(id) {
    return this.request({
      url: `/api/v1/community/news?community_news_id=${id}`,
      method: 'GET',
    })
  }

  // 评论列表
  debateList(id) {
    return this.request({
      url: `/api/community/comment?info=${id}`,
      method: 'GET',
    })
  }

  // 咨询评价
  debate(params) {
    return this.request({
      url: `/api/v1/community/news/comment`,
      method: 'POST',
      params,
    })
  }

  // 评论点赞
  debateLike(params) {
    return this.request({
      url: `/api/v1/community/news/comment/like`,
      method: 'POST',
      params,
    })
  }

  // 参加活动
  joinActivity(params) {
    return this.request({
      url: `/api/v1/community/news/sign_up`,
      method: 'POST',
      params,
    })
  }

  // 发布帖子
  publishTopic(params) {
    return this.request({
      url: `/api/v1/community/news`,
      method: 'POST',
      params,
    })
  }
}

export default new SpecialModel()
